package model_sys

import (
	"wrblog-api-go/app/model"
	"wrblog-api-go/pkg/utils"
)

type SysUser struct {
	DeptId       int        `json:"deptId" form:"deptId"`             //部门id
	Uk           string     `json:"uk" form:"uk" gorm:"required"`     //用户名
	NickName     string     `json:"nickName" form:"nickName"`         //昵称
	SpaceUrl     string     `json:"spaceUrl" form:"spaceUrl"`         //空间url
	Mobile       string     `json:"mobile" form:"mobile"`             //手机号
	Mailbox      string     `json:"mailbox" form:"mailbox"`           //邮箱
	Avatar       string     `json:"avatar" form:"avatar"`             //头像
	Sex          string     `json:"sex" form:"sex"`                   //性别
	RegisterType string     `json:"registerType" form:"registerType"` //注册类型
	UserType     string     `json:"userType" form:"userType"`         //用户类型
	LoginIp      string     `json:"loginIp" form:"loginIp"`           //最后一次登录ip
	LoginDate    utils.Time `json:"loginDate" form:"loginDate"`       //最后一次登录时间
	Status       string     `json:"status" form:"status"`             //状态
}

type SysUserPo struct {
	SysUser
	UserId int64  `json:"userId" form:"userId" gorm:"primaryKey;autoIncrement"` //用户id
	Pk     string `json:"pk" form:"pk"`
	model.BaseEntity
}

type SaveSysUser struct {
	SysUser
	UserId string `json:"userId" form:"userId" gorm:"primaryKey;autoIncrement"` //用户id
	Pk     string `json:"pk" form:"pk"`
	model.BaseEntity
}

func (SaveSysUser) TableName() string {
	return "sys_user"
}

func (SysUserPo) TableName() string {
	return "sys_user"
}

type SelectSysUser struct {
	Uk           string `json:"uk" form:"uk"`                     //用户名
	NickName     string `json:"nickName" form:"nickName"`         //昵称
	SpaceUrl     string `json:"spaceUrl" form:"spaceUrl"`         //空间url
	Mobile       string `json:"mobile" form:"mobile"`             //手机号
	Mailbox      string `json:"mailbox" form:"mailbox"`           //邮箱
	Sex          string `json:"sex" form:"sex"`                   //性别
	RegisterType string `json:"registerType" form:"registerType"` //注册类型
	UserType     string `json:"userType" form:"userType"`         //用户类型
	Status       string `json:"status" form:"status"`             //状态
	model.SelectBaseEntity
}

type SysUserVo struct {
	UserId string `json:"userId" form:"userId"`
	SysUser
	model.BaseEntityVo
}
